const SYSTEM_INFO = uni.getSystemInfoSync();

//获取状态栏的高度
export const getStatusBarHeight = ()=> SYSTEM_INFO.statusBarHeight || 15;

//获取胶囊按钮的高度
export const getTitleBarHeight = ()=>{
	if(uni.getMenuButtonBoundingClientRect){
		let {top,height} = uni.getMenuButtonBoundingClientRect();
		return height + (top - getStatusBarHeight())*2		
	}else{
		return 40;
	}
}

//计算要填充的高度
export const  getNavBarHeight = ()=> getStatusBarHeight()+getTitleBarHeight();

//对抖音的小程序的左上角的图标计算高度
export const getLeftIconLeft = ()=> {
	// #ifdef MP-TOUTIAO
		let {leftIcon:{left,width}}  = tt.getCustomButtonBoundingClientRect();
		return left+ parseInt(width);
	// #endif
	
	// #ifndef MP-TOUTIAO
		return 0
	// #endif	
}


// 获取屏幕宽度
export const getScreenWidth = () => SYSTEM_INFO.screenWidth || 375;

// 获取屏幕高度
export const getScreenHeight = () => SYSTEM_INFO.screenHeight || 667;